package creationalPattern.singleton;

public class SingleTon {
    private volatile static SingleTon unitInstance;

    private SingleTon() {
    }
    public static SingleTon getInstance() {
        if (unitInstance == null) {
            synchronized (SingleTon.class) {
                if (unitInstance == null) {
                    unitInstance = new SingleTon();
                }
            }
        }
        return unitInstance;
    }
}
